package com.weixiaodong.ModelDesign.生成实例.Prototype模式.复制模式实例演示;

public class Main {
    public static void main(String[] args) {
        Manager manager = new Manager();

        MessageBox box1 = new MessageBox('~');

        MessageBox box2 = new MessageBox('+');

        manager.register("-box", box1);

        manager.register("+box", box2);

        box1.use("hello wolrd");
        System.out.println();
        box2.use("hello java");

        System.out.println();
        Product product = manager.create("-box");
        product.use("副本");
    }
}
